package com.harvestdiary.pojo;

import com.harvestdiary.other.tools.SettingFontIcon;
import com.jfoenix.controls.JFXButton;
import javafx.geometry.Insets;
import javafx.scene.control.Label;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import lombok.Data;
import org.kordamp.ikonli.antdesignicons.AntDesignIconsFilled;

import java.time.LocalDate;


@Data
public class Lattice {
    private LocalDate localDate;
    private StackPane stackPane;
    private JFXButton jfxButton;
    private VBox vBox;
    private Label date;
    private Label chineseDate;
    private Label sDiary;
    private Label diary;

    public Lattice(){
        stackPane = new StackPane();

        vBox = new VBox();
        vBox.setAlignment(javafx.geometry.Pos.CENTER);
        vBox.setMaxHeight(77.0);
        vBox.setMaxWidth(77.0);
        vBox.setPrefHeight(77.0);
        vBox.setPrefWidth(77.0);

        date = new Label("Label");
        date.setFont(Font.font(14));
        VBox.setMargin(date, new Insets(5, 0, 2, 0)); // 设置下边距

        chineseDate = new Label("Label");
        chineseDate.setFont(Font.font(12));

        HBox hBox = new HBox();
        hBox.setAlignment(javafx.geometry.Pos.CENTER);
        hBox.setMaxHeight(18.0);
        hBox.setMaxWidth(18.0);
        hBox.setPrefHeight(18.0);
        hBox.setPrefWidth(18.0);

        diary = new Label();
        diary.setFont(Font.font(10));
        diary.setGraphic(SettingFontIcon.setSizeAndColor(AntDesignIconsFilled.EDIT, 15, Color.web("#617172")));
        diary.setOpacity(0);
        VBox.setMargin(diary, new Insets(5.0, 0, 0, 0)); // 设置下边距

        sDiary = new Label();
        sDiary.setFont(Font.font(10));
        sDiary.setGraphic(SettingFontIcon.setSizeAndColor(AntDesignIconsFilled.CLOUD, 15, Color.web("#617172")));
        sDiary.setOpacity(0);

        jfxButton = new JFXButton(" ");
        jfxButton.setPrefHeight(77.0);
        jfxButton.setPrefWidth(77.0);

        jfxButton.setStyle
                ("-fx-background-radius: 50;" +
                        "-fx-border-radius: 50");


        hBox.getChildren().addAll(diary, sDiary);
        vBox.getChildren().addAll(date, chineseDate, hBox);
        stackPane.getChildren().addAll(vBox, jfxButton);
    }


}
